package com.iyundao.io.mapper;

import com.iyundao.io.model.IntegralRecord;

import static org.apache.ibatis.jdbc.SqlBuilder.*;

public class IntegralRecordSqlProvider {

    public String insertSelective(IntegralRecord record) {
        BEGIN();
        INSERT_INTO("integralrecord");
        
        if (record.getId() != null) {
            VALUES("id", "#{id,jdbcType=INTEGER}");
        }
        
        if (record.getPartymemberid() != null) {
            VALUES("partymemberid", "#{partymemberid,jdbcType=INTEGER}");
        }
        
        if (record.getIntegralrecordnum() != null) {
            VALUES("integralrecordnum", "#{integralrecordnum,jdbcType=INTEGER}");
        }
        
        if (record.getIntegralrecordtime() != null) {
            VALUES("integralrecordtime", "#{integralrecordtime,jdbcType=TIMESTAMP}");
        }
        
        if (record.getActivityid() != null) {
            VALUES("activityid", "#{activityid,jdbcType=INTEGER}");
        }
        
        if (record.getGiftid() != null) {
            VALUES("giftid", "#{giftid,jdbcType=INTEGER}");
        }
        
        if (record.getUserid() != null) {
            VALUES("userid", "#{userid,jdbcType=INTEGER}");
        }
        
        return SQL();
    }
}